//
//  AAAVC.m
//  QoilPublic
//
//  Created by zhuang on 16/7/5.
//  Copyright © 2016年 杨凯. All rights reserved.
//

#import "AAAVC.h"
#import "QChangeNickNameVC.h"
#import "QDetailsOrderVC.h"
#import "QScanInforMationVC.h"
#import "QPerfectOrderInforMationVC.h"
#import "QJudgeVC.h"
#import "QMyCouponsVC.h"
#import "QConfirmOrderInforMationVC.h"
#import "QTopupMoneyVC.h"
#import "QMapLocationVC.h"
#import "QPayMoneyVC.h"
#import "QSetUpPassWordVC.h"
#import "QSendingMapVC.h"
#import "QChargeBookVC.h"
@interface AAAVC ()<UITableViewDataSource, UITableViewDelegate>

@end

@implementation AAAVC{
    
    NSArray *arr;
    UITableView *_tableView;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight) style:UITableViewStyleGrouped];
    _tableView.dataSource = self;
    _tableView.delegate = self;
    [self.view addSubview:_tableView];
    arr = @[@"修改昵称",@"订单详情-未付款",@"会员专享下单",@"确认订单信息",@"完善订单信息",@"评价",@"优惠券",@"确认订单信息",@"订单详情地图",@"充值",@"地图",@"支付",@"设置密码",@"记账本"];
    
    
    _tableView.mj_header = [QViewUtility showHeadRefresh:^{
        [QViewUtility showMBHudToView:self.view hideBg:NO];
        [self performSelector:@selector(jjj) withObject:self afterDelay:5];
    }];
    
    //[_tableView.header beginRefreshing];
}

- (void)jjj{
    [QViewUtility hideMBHudToView:self.view];
    [_tableView.mj_header endRefreshing];
}

#pragma mark --- tableViewDelegate


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    
    return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return arr.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *identify = @"cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identify];
    if(!cell){
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identify];
    }
    cell.textLabel.text = arr[indexPath.row];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    switch (indexPath.row) {
        case 0:
        {
            QChangeNickNameVC *vc = [[QChangeNickNameVC alloc] init];
            [self.navigationController pushViewController:vc animated:YES];
        }
            break;
        case 1:
        {
        }
            break;
            
            break;
        case 2:
        {
            
            CLog(@"===");
            
        }
            break;
        case 3:
        {
            QScanInforMationVC *vc = [[QScanInforMationVC alloc] init];
            [self.navigationController pushViewController:vc animated:YES];
            
        }
            break;
        case 4:
        {
            QPerfectOrderInforMationVC *vc = [[QPerfectOrderInforMationVC alloc] init];
            [self.navigationController pushViewController:vc animated:YES];
            
        }
            break;
        case 5:
        {
            QJudgeVC *vc = [[QJudgeVC alloc] init];
            [self.navigationController pushViewController:vc animated:YES];
            
        }
            break;
        case 6:
        {
            QMyCouponsVC *vc = [[QMyCouponsVC alloc] init];
            [self.navigationController pushViewController:vc animated:YES];
            
        }
            break;
        case 7:
        {
            QConfirmOrderInforMationVC *vc = [[QConfirmOrderInforMationVC alloc] init];
            [self.navigationController pushViewController:vc animated:YES];
            
        }
            break;
        case 8:
        {
            QSendingMapVC *vc = [[QSendingMapVC alloc] init];
            [self.navigationController pushViewController:vc animated:YES];
            
        }
            break;
        case 9:
        {
            QTopupMoneyVC *vc = [[QTopupMoneyVC alloc] init];
            [self.navigationController pushViewController:vc animated:YES];
            
        }
            break;
        case 10:
        {
            QMapLocationVC *vc = [[QMapLocationVC alloc] init];
            [self.navigationController pushViewController:vc animated:YES];
            
        }
            break;
        case 11:
        {
            QPayMoneyVC *vc = [[QPayMoneyVC alloc] init];
            [self.navigationController pushViewController:vc animated:YES];
            
        }
            break;
        case 12:
        {
            QSetUpPassWordVC *vc = [[QSetUpPassWordVC alloc] init];
            [self.navigationController pushViewController:vc animated:YES];
            
        }
            break;
        case 13:
        {
            QChargeBookVC *vc = [[QChargeBookVC alloc] init];
            [self.navigationController pushViewController:vc animated:YES];
            
        }
            break;
            
        default:
            break;
    }
    
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    
    return 0.01;
}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    
    return 0.01;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    return [[UIView alloc] init];
}
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
    return [[UIView alloc] init];
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath{
    
}

@end
